import request from "@/utils/request";

export function getMerchantById(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/checkById',
        method: 'post',
        data
    })
}


export function searchMerchants() {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/selectAll',
        method: 'post'
    });
}

// 查询＋分页
export function searchPage(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/page',
        method: 'post',
        data
    });
}

export function add(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/add',
        method: 'post',
        data
    });
}


export function find(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/checkById',
        method: 'post',
        data
    });
}


export function update(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/update',
        method: 'post',
        data
    });
}



export function page(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/page',
        method: 'post',
        data
    });
}


export function remove(data) {
    return request({
        //设置请求数据格式为json
        headers: {"Content-Type": "application/json;charset=UTF-8"},
        url: '/api/admin/merchant/removeIds',
        method: 'post',
        data
    });
}

export function deleteMerchants(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/deleteMerchants',
        method: 'post',
        data
    });
}


export function merchantPass(data) {
    return request({
        headers: {"Content-Type": "application/json;charset=UTF-8"},
        url: '/api/admin/merchant/passMerchants',
        //post请求
        method: 'post',
        data
    });
}



export function searchProvince() {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/listProvinces',
        method: 'post',
     });
}

export function searchCity(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/listCities',
        method: 'post',
        data
    });
}

export function searchDistrict(data) {
    return request({
        //设置请求数据格式为json
        url: '/api/admin/merchant/listDistricts',
        method: 'post',
        data
    });
}
